import request from '@/utils/request'

export function getaAddPtsTable (parameter) {
  return request({
    url: '/boss/project/manage/addPtsTable',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
export function list (parameter) {
  return request({
    url: '/boss/project/manage/listPts',
    method: 'post',
    data: parameter
  })
}
export function centerList (parameter) {
  return request({
    url: '/boss/project/manage/listResearch',
    method: 'post',
    data: parameter
  })
}
export function addPts (parameter) {
  return request({
    url: '/boss/project/manage/addPts',
    method: 'post',
    data: parameter
  })
}
export function getSubjectExport (parameter) {
  return request({
    url: '/boss/project/manage/subjectExport',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
export function informationDoc (parameter) {
  return request({
    url: '/boss/project/pts/informationDoc',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
export function PtsDetails (parameter) {
  return request({
    url: '/boss/project/manage/getPtsDetails',
    method: 'post',
    data: parameter
  })
}
export function doctorList (parameter) {
  return request({
    url: '/boss/project/manage/listDoctor',
    method: 'post',
    data: parameter
  })
}
export function upDatePtsStatus (parameter) {
  return request({
    url: '/boss/project/manage/updatePtsStatus',
    method: 'post',
    data: parameter
  })
}
export function updatePtsReId (parameter) {
  return request({
    url: '/boss/project/manage/updatePtsReId',
    method: 'post',
    data: parameter
  })
}
export function updatePtsAuth (parameter) {
  return request({
    url: '/boss/project/manage/updatePtsAuth',
    method: 'post',
    data: parameter
  })
}
export function delPts (parameter) {
  return request({
    url: '/boss/project/manage/delPts',
    method: 'post',
    data: parameter
  })
}
export function delGuardian (parameter) {
  return request({
    url: '/boss/project/manage/delGuardian',
    method: 'post',
    data: parameter
  })
}
export function updateGuardianUserAuthorizeType (parameter) {
  return request({
    url: '/boss/project/manage/updateGuardianUserAuthorizeType',
    method: 'post',
    data: parameter
  })
}
export function getListInterView (parameter) {
  return request({
    url: '/boss/project/manage/listInterview',
    method: 'post',
    data: parameter
  })
}
export function getVisitDetail (parameter) {
  return request({
    url: '/boss/project/manage/listVisit',
    method: 'post',
    data: parameter
  })
}
export function reinviteSubject (parameter) {
  return request({
    url: '/boss/project/manage/anewInvitePts',
    method: 'post',
    data: parameter
  })
}
export function anewInviteGuardian (parameter) {
  return request({
    url: '/boss/project/manage/anewInviteGuardian',
    method: 'post',
    data: parameter
  })
}
export function canPts (parameter) {
  return request({
    url: '/boss/project/manage/updatePtsUserAuthorizeType',
    method: 'post',
    data: parameter
  })
}
export function ptsTypes (parameter) {
  return request({
    url: '/v2/boss/project/cost/ptsTypes',
    method: 'post',
    data: parameter
  })
}
export function isExistsFeeApplying (parameter) {
  return request({
    url: '/boss/project/manage/isExistsFeeApplyUnComplete',
    method: 'post',
    data: parameter
  })
}
export function editPts (parameter) {
  return request({
    url: '/boss/project/manage/editPts',
    method: 'post',
    data: parameter
  })
}
export function editGuardian (parameter) {
  return request({
    url: '/boss/project/manage/editGuardian',
    method: 'post',
    data: parameter
  })
}
export function deleteGuardian (parameter) {
  return request({
    url: '/boss/project/manage/deleteGuardian',
    method: 'post',
    data: parameter
  })
}
export function exportTemplate (parameter) {
  return request({
    url: '/boss/project/manage/exportTemplate',
    method: 'post',
    params: parameter,
    responseType: 'blob'
  })
}
export function getPtsCostDetails (parameter) {
  return request({
    url: '/boss/project/manage/getPtsCostDetails',
    method: 'post',
    params: parameter
  })
}

/**
 * 获取受试者邀请记录
 * @param parameter
 * @return {AxiosPromise}
 */
export function apiGetSubjectInvitedRecord (parameter) {
  return request({
    url: '/boss/project/invited_record/listForPts',
    method: 'get',
    params: parameter
  })
}

/**
 * 通过二维码添加受试者
 * @param parameter
 * @return {*}
 */
export function apiAddPtsForQrCode (parameter) {
  return request({
    url: '/boss/project/manage/addPtsForQrCode',
    method: 'post',
    data: parameter
  })
}


/**
 * 获取短信验证码 加入研究项目
 * @param parameter
 * @return {*}
 */
export function apiGetMessage (parameter) {
  return request({
    url: '/boss/admin/info/send',
    method: 'post',
    data: parameter
  })
}

/**
 * 校验短信验证码
 * @param parameter
 * @return {*}
 */
export function apiVerifyMessageCode (parameter) {
  return request({
    url: '/boss/admin/info/check',
    method: 'post',
    data: parameter
  })
}

/**
 * 受试者扫码填写信息后加入小程序
 * @param parameter
 * @return {*}
 */
export function apiInviteToWxByCode (parameter) {
  return request({
    url: '/client/pts/pro/anewInvitePtsCode',
    method: 'post',
    data: parameter
  })
}
/**
 * 委托者扫码填写信息后加入小程序
 * @param parameter
 * @return {*}
 */
export function anewInviteGuardianCode (parameter) {
  return request({
    url: '/client/pts/pro/anewInviteGuardianCode',
    method: 'post',
    data: parameter
  })
}
/*
 * 根据手机号检测是否使用过
 * @param parameter
 * @return {AxiosPromise}
 */
export function checkByPhone (parameter) {
  return request({
    url: '/boss/project/manage/checkByPhone',
    method: 'get',
    params: parameter
  })
}

export function batchImportPts (parameter) {
  return request({
    url: '/boss/project/manage/batchImportPts',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function getCancelList (parameter) {
  return request({
    url: '/boss/project/pts/unsubscribeList',
    method: 'get',
    params: parameter
  })
}

export function confirmCancel (parameter) {
  return request({
    url: '/boss/project/pts/unsubscribeList/confirm',
    method: 'post',
    data: parameter
  })
}
// 下载信息包
export function getPtsZipPack (parameter) {
  return request({
    url: '/boss/project/manage/getPtsZipPack',
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}
export function ptsZipPackAndRemove (parameter) {
  return request({
    url: '/boss/project/manage/PtsZipPackAndRemove',
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}
